package com.ddd.mill.infrastructure.exception;


import com.ddd.mill.infrastructure.constant.BusinessErrorCode;

public class BizException extends RuntimeException {

    private Integer errorCode;
    private String errorMessage;

    public Integer getErrorCode() {
        return this.errorCode;
    }

    public String getErrorMessage() {
        return this.errorMessage;
    }

    public BizException(Integer errorCode, String errorMsg) {
        super(errorMsg);
        this.errorCode = errorCode;
        this.errorMessage = errorMsg;
    }

    public BizException(String errorMsg) {
        this.errorCode = BusinessErrorCode.BUSINESS_ERROR;
        this.errorMessage = errorMsg;
    }
}
